<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="INDEX/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="INDEX/css/main.css"/>
		<link rel="stylesheet" type="text/css" href="INDEX/css/news_board.css"/>
	</head>

	<body>
		<script src="INDEX/js/mui.min.js"></script>
		<script type="text/javascript">
			mui.init()
		</script>
		<script src="INDEX/js/mui.min.js"></script>
		<script src="INDEX/js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>	
		<script>
			mui.init();
		</script>
		<header class="mui-bar mui-bar-nav">
			<a href="#offCanvasSide" class="right_top"></a>
			<!--<a class="mui-switch "></a>-->
			<div class="mui-switch mui-pull-right {if $think_var=='zh-cn'}mui-active{/if}" id="mySwitch">
  				<div class="mui-switch-handle"></div>
			</div>
			<h1 class="mui-title">{$Think.lang.project_title}</h1>
		</header>
		<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable mui-slide-in">
			<div id="header">{include file='header'/}</div>
			<div class="mui-inner-wrap">
				<div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper mui-slide-in">
					<div class="mui-scroll">
						<div class="news_content">
							<div class="news_content_top">
								<div style="position: relative;">
								<textarea name="question"  id="textArea" rows="10" cols="10" placeholder="{$Think.lang.not_question_input}" style="border: none;"></textarea>
								<span class='two'><span id="textNum">0</span>/200</span>
								</div>
								<div class="question_type">
									<label for="">{$Think.lang.not_cate}:</label>
									<input type="text" id="type_que" placeholder="{$Think.lang.not_answer_input}" readonly="readonly"/>
									<span class="mui-icon mui-icon-arrowright" style="font-size: 22px;color: #000;"></span>
								</div>
								<div class="question_list">
								  <ul>
									  {foreach $category as $cate}
									  {if condition = "$think_var eq 'zh-cn'"}
									  <!-- <li class="add_bg">请选择</li> -->
									<li class="" data="{$cate['id']}">{$cate['advisory_name']}</li>
									{else}
										<!-- <li class="add_bg">please select</li> -->
									<li class="" data="{$cate['id']}">{$cate['advisory_name_en']}</li>
									{/if}
									  {/foreach}
								  </ul>
								</div>
							</div>
							<div class="submit">{$Think.lang.set_submit}</div>
							<div class="show_my_news">{$Think.lang.not_select}</div>
						</div>
					</div>
				</div>
			</div>	
		</div>
		<script src="INDEX/js/switchover.js"></script>
		<script src="INDEX/js/jquery-1.8.0.min.js" type="text/javascript" charset="utf-8"></script>
		
		<!-- <script src="INDEX/js/main.js" type="text/javascript" charset="utf-8"></script> -->
		<script>
			$(function(){
				$(".question_type").click(function(){
					$(".question_list").css("display","block")
				})
				/************************************/
				$(".question_list ul li").click(function(){
					if(!$(this).hasClass("add_bg")){
						$(this).addClass("add_bg");
						$(this).siblings().removeClass("add_bg");
						$(".question_list").css("display","none");
						$("#type_que").val($(this).html())
					}
				})
				$(".show_my_news").click(function(){
					window.location.href = "{:Url('index/notice/index')}";
				})

				$(".news_content .submit").click(function(e){
					var textArea = $("#textArea").val();
					if(textArea == ""){
						mui.toast("{$Think.lang.not_question_input}");
					return false;
					}
					var question = $(".question_list").find(".add_bg").attr("data");
					if(question == "")
					{
						mui.toast("{$Think.lang.not_answer_input}");
					return false;
					}
					mui.confirm("{$Think.lang.sure_submit}","",["{$Think.lang.btn_cancel}","{$Think.lang.btn_sure}"],function(e){
						if(e.index==1){
							$.post("{:Url('Notice/add')}", {
								"textArea" : textArea,
								"question" : question,
							}, function(data) {
								if (data['code'] > 0) {
									mui.toast(data["message"])
								} else {
									mui.toast(data["message"])
								}
							});
				
							
						}else{
							return
						}
					})
				})

					
			})
		</script>
	</body>

</html>